﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QSpacerItem>
#include <QHBoxLayout>
#include <QDebug>
#include <QRect>
#include <QPoint>
#include <QEvent>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QPaintEvent>
#include <QPainter>
#include <QMessageBox>
#include <QColor>
#include <QColorDialog>
#include "help.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
protected:
    void UI_init();
    bool event(QEvent *sys_event);
    void paintEvent(QPaintEvent *paint);
    void mouseMoveEvent(QMouseEvent *mouseMove);
    void mousePressEvent(QMouseEvent *mousePress);
    void mouseReleaseEvent(QMouseEvent *mouseRelease);
    void mouseDoubleClickEvent(QMouseEvent *mouseDoubleClick);
    void keyPressEvent(QKeyEvent *keyPress);

private slots:

    void on_actHelp_triggered();

    void on_actQuit_triggered();

    void on_acMinSize_triggered();

    void on_actMaxSize_triggered();

    void on_acRestore_triggered();

private:
    Ui::MainWindow *ui;
    QPoint pressPoint;  //鼠标右键按下坐标
    QColor bgColor;     //painter颜色
    QMessageBox quitMbox;   //退出对话框
    Help* HelpDialog;       //使用帮助窗口
    int pressMouseButton;   //鼠标按键
};
#endif // MAINWINDOW_H
